#include <iostream>
#include <string>
#include <vector>
#include <algorithm>

class Strategy
{
public:
    virtual int execute(int a, int b) = 0;
};

class ConcreteStrategyAdd : public Strategy
{
public:
    int execute(int a, int b) override
    {
        return a + b;
    }
};

class ConcreteStrategySubtract : public Strategy
{
public:
    int execute(int a, int b) override
    {
        return a - b;
    }
};

class ConcreteStrategyMultiply : public Strategy
{
public:
    int execute(int a, int b) override
    {
        return a * b;
    }
};

class Context{
private:
    Strategy* strategy = nullptr;
public:
    Context()
    {
        setStrategy(new ConcreteStrategyAdd());
    }
    void setStrategy(Strategy* strategy_)
    {
        strategy = strategy_;
    }
    void executeStrategy(int a, int b)
    {
        std::cout<<"strategy "<<a <<","<<b<<" = "<< strategy->execute(a,b)<<std::endl;
    }

};
int main() {
    Context context;
    context.executeStrategy(5,2);
    context.setStrategy(new ConcreteStrategyMultiply);
    context.executeStrategy(5,2);
    return 0;
}



